package org.grayrabbit.cms.publish.generate;

import org.grayrabbit.cms.publish.api.Publishable;

public class ContentMission extends Mission {
	private int currentContentIndex;
	public int getCurrentContentIndex() {
		return currentContentIndex;
	}

	public void setCurrentContentIndex(int currentContentIndex) {
		this.currentContentIndex = currentContentIndex;
	}

	public boolean hasNext() {
		return currentContentIndex<this.getContentNum();
	}

	public void remove() {

	}

	@Override
	public GenTask next() {
		if(currentContentIndex<this.getContentNum()){
			GenTask task = new GenTask();
			task.setList(getList());
			task.setType(Publishable.CONTENT_GEN);
			task.setMission(this);
			task.setAdmin(getAdmin());
			currentContentIndex = this.getContentNum();
			return task;
		}
		return null;
	}

}
